<?php

require dirname(__FILE__) . DIRECTORY_SEPARATOR . "db.conf.php";
return array(
    'name' => 'nexttv',
    'language' => 'zh_cn',
    'basePath' => dirname(__FILE__) . DIRECTORY_SEPARATOR . '..',
    'defaultController' => 'index',
    'preload' => array(
        'log',
    ),
    'import' => array(
        'application.models.*',
        'application.components.*',
        'application.utils.*',
        'application.common.*',
        'application.modules.core.models.*',
        'application.modules.core.components.*',
        'application.modules.admin.models.*',
        'application.modules.api.components.*',
        'application.modules.api.service.*',
        'application.modules.msgg.models.*',
        'application.modules.msgg.components.*',
        'application.modules.msgg.channel.*',
        'application.modules.msgg.channel.config.*',
        'application.modules.msgg.core.*',

    ),

    'modules' => array(
        'gii' => array(
            'class' => 'system.gii.GiiModule',
            'password' => 'init',
            'ipFilters' => array('127.0.0.1', '10.0.0.*','192.168.56.1'),
        ),
        'admin',
        'msgg',
        'core',
        'manage',
        'advice',
    ),
    'components' => array(
        'user' => array(
            'class' => 'application.components.WebUser',
            'allowAutoLogin' => true,
            'loginUrl' => array('/account/login'),
        ),
        'menu' => array(
            'class' => 'application.components.MenuManage',
        ),
        'api' => array(
            'class' =>'application.modules.api.components.ApiAgent',
        ),
        'bootstrap' => array(
            'class' => 'ext.bootstrap.components.Bootstrap',
        ),
        'composer' => array(
            'class' => 'ext.composer.composer',
        ),
        'db' => array(
            'class' => 'CDbConnection',
            'connectionString' => 'mysql:host=' . DB_HOST . ';dbname=' . DB_NAME,
            'username' => DB_USER,
            'password' => DB_PASSWD,
            'emulatePrepare' => true,
            'charset' => 'utf8',
        ),
        'log' => array(
            'class' => 'CLogRouter',
            'routes' => array(
                array(
                    'class'=>'CFileLogRoute',
                    'levels'=>'info,error,warning',
                    'categories'=>'Curl.*',
                    'logFile'=>'Curl.log'
                ),
                array(
                    'class' => 'CFileLogRoute',
                    'levels' => 'error, info',
                ),
                array(
                    'class' => 'CDbLogRoute',
                    'autoCreateLogTable' => false,
                    'connectionID' => 'db',
                    'levels' => 'error',
                    'logTableName' => 'log',
                ),
            ),
        ),
        'urlManager' => array(
            'urlFormat' => 'path',
            'showScriptName' => false,
            'rules' => array(
                'api/<controller:\w+>/<action:\w+>' => 'api/default/<controller>/<action>',
                '<module:\w+>/<controller:\w+>/<action:\w+>' => '<module>/<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ),
        ),
        'cache' => array(
            'class' => 'CFileCache',
        ),
        'request'=>[
        ]
    ),
    'params' => array_merge(require(dirname(__FILE__) . '/params.php')),
);